# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  
  def create_select_categoria
    return %@
      <select id="categoria" name="categoria">
       <option value="m" > Masculino </option>
       <option value="f"> Femenino </option>
      </select>
     @
  end
  
  def create_select_categoria_module(module_name)
    return %@
      <select id="#{module_name}_categoria" name="#{module_name}[categoria]">
       <option value="m" > Masculino </option>
       <option value="f"> Femenino </option>
      </select>
     @
  end
  
  def create_line( label, num, object1, field, helper= "text_field")
    fila_calss = "fila_clara"
    fila_calss = ""   if num.odd?
    
    return %@
    <tr class="#{fila_calss}">
    
    <td><label for=" #{object1}_#{field}"> #{ label } </label> </td>
      <td>#{ eval "#{helper} '#{object1}', '#{field}',  {:class => 'required validate-number'} " }</td>
    </tr>
     @
  end
  
  def human_record_description description
       case description
          when "pts"
            return "Puntos anotados en un partido"
    
          when "flt"
            return "Faltas"
    
          when "ptsf"
            return  "Puntos de tres anotados"
    
          when "rbt"
            return "Rebotes"
    
          when "pts"
            return "Puntos anotados en un partido"
    
          when "bprd"
            return "Balones perdidos"
    end
  end
  
  
  
end
